package com.xszx.interceptor;

import java.util.Arrays;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 
 * @author renlihuang
 *拦截器配置
 */
@Configuration
public class interceptorConfig implements WebMvcConfigurer {
    
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		//注册拦截器，拦截出登录意外的所有请求
		registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**").excludePathPatterns(Arrays.asList("/Chart/**","/img/**","/layui/**","/login","/toLogin"));
		
	}
	
}
